<?php
class adminController
{
	function index()
	{
		$smarty = new BlogSmarty();
		
		$smarty_articles = array();
		
		$articles = ArticlesQuery::create()->orderByDateCreated("desc")->find();
		foreach($articles as $article) {
			$smarty_articles[] = array("id" => $article->getId(), "title" => $article->getTitle());
		}
		
		$smarty->assign("posts", $smarty_articles);
		
		$smarty->display("admin.tpl");
	}
}
?>
